package com.youpai.platform.vulture.common.enums;

/**
 * @date: 2022/6/23 21:28
 * @author: Anna
 * @version: 1.0
 * @description: 消息flag类型
 */
public enum MsgFlagEnum {

    HEART_BEAT_PING(0, "心跳包"),
    HEART_BEAT_PONG(1, "心跳包"),
    HAND_SHAKE(2, "握手包"),
    ORDINARY_MSG(3, "command消息"),
    ;

    public final int flag;
    public final String desc;

    MsgFlagEnum(int flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public static boolean isSupportFlag(int flag) {
        for (MsgFlagEnum flagEnum : MsgFlagEnum.values()) {
            if (flagEnum.flag == flag) {
                return true;
            }
        }
        return false;
    }
}
